/**
 * User: Mauro
 * Date: 30/09/11
 * Time: 16:58
 */
jQuery(document).ready(function() {
    $('#photo').maZoom({
        zoomImageWidth: 1000,
        zoomImageHeight: 750
    });

    /****
     * only for mouse
     */
    var trackMouse = function(cur) {
        var mousePosX = cur.pageX;
        var mousePosY = cur.pageY;

        $('#mouse').stop().animate({
            marginLeft: mousePosX+10,
            marginTop:  mousePosY+10
        },100,'easeOutCubic');
    };

    var trackClick = function() {
        var el = $('#mouse');
        if(el.data('click') === undefined || !el.data('click'))
        {
            $('#mouse').data('click',true);
            $('#mouse').addClass('xtrack');
        }
        else
        {
            $('#mouse').data('click',false);
            $('#mouse').removeClass('xtrack');
        }
    }

    $('#photo').bind('mousemove',trackMouse);
    $('#photo').bind('click',trackClick);
});